/**
 * 
 */
package com.ihg.hiex.entity.session.during;

import org.apache.commons.lang3.StringUtils;

import com.demo2do.core.utils.Alias;

/**
 * @author downpour
 *
 */
@Alias("SessionCalibrationStatus")
public enum SessionCalibrationStatus {
    
    CREATED("created", "已创建"),
    
    EDITING("editing", "修改中"),
    
    FINISH("finish", "已完成");

    private String description;
    
    private String alias;
    
    /**
     * 
     * @param description
     * @param alias
     */
    SessionCalibrationStatus(String description, String alias) {
        this.description = description;
        this.alias = alias;
    }

    /**
     * 
     * @param alias
     * @return
     */
    public static SessionCalibrationStatus aliasOf(String alias) {
        for(SessionCalibrationStatus sessionCalibrationStatus : SessionCalibrationStatus.values()) {
            if(StringUtils.equalsIgnoreCase(sessionCalibrationStatus.getAlias(), alias)) {
                return sessionCalibrationStatus;
            }
        }
        return null;
    }
    
    /**
     * 
     * @return
     */
    public boolean isCreated() {
        return this.equals(CREATED);
    }
    
    /**
     * 
     * @return
     */
    public boolean isEditing() {
        return this.equals(EDITING);
    }
    
    /**
     * 
     * @return
     */
    public boolean isFinish(){
        return this.equals(FINISH);
    }
    
    /**
     * @return the description
     */
    public String getDescription() {
        return description;
    }

    /**
     * @return the alias
     */
    public String getAlias() {
        return alias;
    }

}
